package com.jindy.module.approvalRecord.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jindy.common.annotation.Excel;
import com.jindy.common.core.domain.BaseEntity;

/**
 * 审批记录对象 t_approval_record
 * 
 * @author jindy
 * @date 2023-03-28
 */
@Data
public class ApprovalRecord extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 自增id */
    private Long id;

    /** 流水单号 */
    @Excel(name = "流水单号")
    private String serialNum;

    /** 操作类型 */
    @Excel(name = "操作类型")
    private String typeOperation;

    /** 申请人id */
    @Excel(name = "申请人id")
    private Long userId;

    /** 申请人 */
    @Excel(name = "申请人")
    private String userName;

    /** 审批顺序 */
    @Excel(name = "审批顺序")
    private Integer sequence;

    /** 审批人id(user_id) */
    @Excel(name = "审批人id(user_id)")
    private Long approverId;

    /** 审批人姓名(username) */
    @Excel(name = "审批人姓名(username)")
    private String approverName;

    /** 审批状态（1同意，2驳回） */
    @Excel(name = "审批状态", readConverterExp = "1=同意，2驳回")
    private String approvalStatus;

    /** 审批时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date approvalTime;

    /** 审批备注 */
    @Excel(name = "审批备注")
    private String approvalRemark;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String deferredRemark;

    /** 业务表状态 */
    @Excel(name = "业务表状态")
    private String businessStatus;

    /** 项目名称 */
    @Excel(name = "项目名称")
    private String projectName;

    /** 订单id */
    @Excel(name = "订单id")
    private Long orderId;

    /** 角色 */
    @Excel(name = "角色")
    private String role;

    public ApprovalRecord() {
    }

    public ApprovalRecord(String serialNum, Long approverId, String approvalStatus) {
        this.serialNum = serialNum;
        this.approverId = approverId;
        this.approvalStatus = approvalStatus;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("serialNum", getSerialNum())
            .append("typeOperation", getTypeOperation())
            .append("userId", getUserId())
            .append("userName", getUserName())
            .append("sequence", getSequence())
            .append("approverId", getApproverId())
            .append("approverName", getApproverName())
            .append("approvalStatus", getApprovalStatus())
            .append("approvalTime", getApprovalTime())
            .append("approvalRemark", getApprovalRemark())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .append("deferredRemark", getDeferredRemark())
            .append("businessStatus", getBusinessStatus())
            .toString();
    }
}
